package com.cloud.service;


import com.cloud.config.FeignConfigToken;
import com.cloud.pojo.UserInfo;
import com.cloud.service.impl.UserManagerFeignServiceImpl;
import com.cloud.tools.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @Author: Tangtao
 * @Date: 2022/5/2 21:46
 * @Description: User deteils tran service invocation based on OpenFeign
 * @ClassName: UserManagerFeignService
 */

@Component
@FeignClient(value = "user-management-service", fallback = UserManagerFeignServiceImpl.class,
                configuration = FeignConfigToken.class)
public interface UserManagerFeignService {


    /* 用户注册 */
    @PostMapping(value = "/user/register")
    public CommonResult register(@RequestBody UserInfo userInfo);

    /* 用户手机号登录 */
    @PostMapping(value = "/user/loginByPhone")
    public CommonResult loginByPhone(@RequestBody Map<String,String> map);

    /* 用户身份证登录 */
    @PostMapping(value = "/user/loginByCardId")
    public CommonResult loginByCardId(@RequestBody Map<String,String> map);

    /* 用户修改个人信息 */
    @PostMapping(value = "/user/updateInfo")
    public CommonResult updateInfo(@RequestBody Map<String,String> map);

    /* 获取个人信息 */
    @GetMapping(value = "/user/getInfo")
    public CommonResult getInfo();

    /* 更改密码 */
    @PostMapping(value = "/user/updatePwd")
    public CommonResult updatePwd(@RequestBody Map<String,String> map);

    @GetMapping(value = "/user/getAllUserInfo")
    public CommonResult getAllUserInfo();

    @PostMapping(value = "/user/delete")
    public CommonResult deleteUserInfo(@RequestBody Map<String,String> map);

    @PostMapping(value = "/user/updateType")
    public CommonResult updateType(@RequestBody Map<String,String> map);

    @GetMapping("/user/Log/check")
    public CommonResult getLog();


}
